package net.csdra.user.component;

import net.csdra.basis.service.ServiceBaseInterface;
import net.csdra.user.domain.User;
import net.csdra.user.component.form.CreateUser;
import net.csdra.user.component.form.UpdateUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * Created by msf on 2018/1/25.
 */
public interface UserComponent extends ServiceBaseInterface<User, CreateUser, UpdateUser> {
    /**
     * 根据userName和password获取用户(delete=false,enable=true)
     *
     * @return
     */
    User getUserByUserNameAndPassWord(String userName, CharSequence password);

    /**
     * 根据userName和temporaryPwd获取用户(delete=false,enable=true)
     *
     * @param userName
     * @param temporaryPwd
     * @return
     */
    User getUserByUserNameAndTemporaryPwd(String userName, CharSequence temporaryPwd);


    /**
     * 忽略enable
     *
     * @param metaId
     * @param authoritys
     * @param pageable
     * @return
     */
    Page<User> findPageByMetaIdAndAuthoritys(String metaId, String authoritys, Pageable pageable);


}
